<?php
/**
 * NOTICE OF LICENSE
 *
 * This source file is subject to the  Academic Free License (AFL 3.0)
 * that is available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to support@zprofess.com so we can send you a copy immediately.
 *
 * @category   	Prestashop module
 * @package		Help Desk
 * @version 	1.0
 * @author 		Kurosaki <kurosaki@zprofess.com>
 * @copyright   Copyright (c) 2012 ZPROFESS. (http://zprofess.com)
 * @license    	http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

ob_start();
include(dirname(__FILE__).'/../../../config/config.inc.php');
/* Getting cookie or logout */
//require_once(dirname(__FILE__).'/init.php');

$customerId = (int)Tools::getValue('customerId', false);

$items = Db::getInstance()->ExecuteS('
SELECT `id_order`
FROM `'._DB_PREFIX_.'orders` 
WHERE `id_customer` = '.(int)$customerId.'
ORDER BY `date_add` DESC');

if ($items)
	foreach ($items AS $item)
            echo '<option value="'.$item['id_order'].'">&nbsp;&nbsp;&nbsp;#0000'.$item['id_order'].'&nbsp;&nbsp;&nbsp;</option>';

